package com.example.trb.component;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.*;

@Configuration
public class TaskExecutorBean {
    /**
     * 用于执行IO密集型任务
     * @return
     */
    @Bean
    public ExecutorService taskExecutor() {
        return new ThreadPoolExecutor(
                12, 130,
                60L, TimeUnit.SECONDS,
                new LinkedBlockingQueue<>()
        );
    }
}
